package com.lagou.stage1.module3.task3;
//(1)定义一个学生类Student，包含属性：姓名(String name)、年龄(int age)
public class Student<T> {

    //定义属性
    private String name;
    private int age;

    //定义无参构造方法
    public Student() {
    }
    //定义有参构造方法
    public Student(String name, int age) {
        setName(name);
        setAge(age);
    }
    //定义get set方法
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }
    //重写toString方法

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}
